package com.xqboss.apps.domain.nft;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xqboss.apps.domain.equipment.Equipment;
import com.xqboss.apps.enums.nft.NftNumberGrantStatusEnum;
import com.xqboss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * nft随机前缀/编号
 * </p>
 *
 * @author HaoLun
 * @since 2022-10-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "NftNumber对象", description = "nft随机前缀/编号")
public class NftNumber extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "藏品id")
    private Long nftId;

    @ApiModelProperty(value = "批次")
    private Long batch;

    @ApiModelProperty(value = "编号数值")
    private Long numberValue;

    @ApiModelProperty(value = "格式：nft随机前缀/编号")
    private String numberValueStr;

    @ApiModelProperty(value = "是否启用此编号,默认1启用,0禁用")
    private Boolean dataEnable;

    @ApiModelProperty(value = "使用方式 1出售,2空投,3合成")
    private Integer destType;

    @ApiModelProperty(value = "是否已发放 0未售,1已售,2已回收")
    private NftNumberGrantStatusEnum isGrant;

    @ApiModelProperty(value = "排序")
    private Long nftSort;

    @ApiModelProperty(value = "当前持有用户id")
    private Long userId;

    @ApiModelProperty(value = "订单号")
    private Long orderCode;

    @ApiModelProperty("售买时间")
    private LocalDateTime payTime;

    @JsonIgnore
    @TableLogic(value = "null",delval = "now()")
    protected Date deleteTime;


    @TableField(exist = false)
    @JsonIgnore
    @ApiModelProperty(value = "藏品的装备属性信息", hidden = true)
    private Equipment equipment;
}
